
let grade = [
    {
        "PK_WorksNoGuid": "cw1",
        "FK_WorksGuid": "w1",
        "FK_CompetitionSteps": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
        "IsRank": null,
        "TotalGrade": null,
        "WorksNocol": null,
        "Status": null,
        "IsDelete": null,
        "works": {
            "PK_WorksGuid": "w1",
            "Auther": null,
            "Content": null,
            "CreateTime": null,
            "LastUpdateTime": null,
            "DeleteTime": null,
            "IsDelete": null,
            "Title": "w1"
        },
        "grade": [
            {
                "PK_GradeGuid": "sdf",
                "FK_WorksNoGuid": "cw1",
                "FK_JudgerGuid": "j1",
                "Grade": 12,
                "CreateTime": null,
                "LastUpdateTime": null,
                "DeleteTime": null,
                "Awards": null,
                "Status": null,
                "IsDelete": null
            },
            {
                "PK_GradeGuid": "sfs",
                "FK_WorksNoGuid": "cw1",
                "FK_JudgerGuid": "j2",
                "Grade": 43,
                "CreateTime": null,
                "LastUpdateTime": null,
                "DeleteTime": null,
                "Awards": null,
                "Status": null,
                "IsDelete": null
            }
        ]
    },
    {
        "PK_WorksNoGuid": "cw2",
        "FK_WorksGuid": "w2",
        "FK_CompetitionSteps": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
        "IsRank": null,
        "TotalGrade": null,
        "WorksNocol": null,
        "Status": null,
        "IsDelete": null,
        "works": {
            "PK_WorksGuid": "w2",
            "Auther": null,
            "Content": null,
            "CreateTime": null,
            "LastUpdateTime": null,
            "DeleteTime": null,
            "IsDelete": null,
            "Title": "w2"
        },
        "grade": []
    },
    {
        "PK_WorksNoGuid": "cw3",
        "FK_WorksGuid": "w3",
        "FK_CompetitionSteps": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
        "IsRank": null,
        "TotalGrade": null,
        "WorksNocol": null,
        "Status": null,
        "IsDelete": null,
        "works": {
            "PK_WorksGuid": "w3",
            "Auther": null,
            "Content": null,
            "CreateTime": null,
            "LastUpdateTime": null,
            "DeleteTime": null,
            "IsDelete": null,
            "Title": "w3"
        },
        "grade": []
    },
    {
        "PK_WorksNoGuid": "cw4",
        "FK_WorksGuid": "w4",
        "FK_CompetitionSteps": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
        "IsRank": null,
        "TotalGrade": null,
        "WorksNocol": null,
        "Status": null,
        "IsDelete": null,
        "works": {
            "PK_WorksGuid": "w4",
            "Auther": null,
            "Content": null,
            "CreateTime": null,
            "LastUpdateTime": null,
            "DeleteTime": null,
            "IsDelete": null,
            "Title": "w4"
        },
        "grade": []
    }
];

let step= {
    "PK_CompetitionStepsGuid": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
    "FK_CompetitionGuid": "12fef250-fc2f-11e7-ad30-19fe793cb1fc",
    "Title": "初赛",
    "Content": "流程内容",
    "Desc": null,
    "Type": "颁奖",
    "QualifiedPerson": 32,
    "SubmitWorks": "提交作品",
    "IsShowWorks": "展示作品内容",
    "IsDelete": null,
    "Status": null,
    "CanUploadWorks": null,
    "IsShowGrade": null,
    "UploadWorksEndTime": null,
    "stepsaward": [
        {
            "FK_CompetitionStepsGuid": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
            "Title": "一等",
            "Num": 3
        },
        {
            "FK_CompetitionStepsGuid": "12fef251-fc2f-11e7-ad30-19fe793cb1fc",
            "Title": "二等奖",
            "Num": 5
        }
    ]};



let gradeArr = [];
for (let index in grade)
{
    let item = grade[index];
    let oneGrade = {};
    oneGrade.Title = item.works.Title;
    oneGrade.Auther = item.works.Auther;
    oneGrade.TotalGrade = 0;
    oneGrade.Grade=[];


    for (let index in item.grade)
    {
        let gradeItem = item.grade[index];
        let grade = gradeItem.Grade;
        oneGrade.Grade.push(grade);
        oneGrade.TotalGrade += grade;
    }
    gradeArr.push(oneGrade);
}


let a = 3;
